/*
 * 创建人：王曙光
 * 创建时间：2011-9-22
 * 功能描述：消息弹框
 */
var timeout = 0;
$(function() {

	//启用拖拽
	Common.DragStart($(".pop_title")[0]);

	//关闭
	$(".close").bind("click", function(event) {
		event.stopPropagation();
		window.nativeWindow.close();
	});
	//延时关闭
	timeout = setTimeout(function() {
		window.nativeWindow.close();
	}, Const.pop._timeout);

	//初始化数据
	var bodyHtml = "";
	if(window.returnValue.split("$#$")[1].trim() !== "") {
		$(".pop_name").html(window.returnValue.split("$#$")[1]);
	} else {
		$(".pop_name").html("系统寻呼");
	}
	var msgStr = window.returnValue.split("$#$")[2];
	if(msgStr.length > 42) {
		msgStr = msgStr.substring(0, 42) + "...";
	}
	$(".pop_content").html(msgStr);

	$(".pop_title,.pop_body").click(function() {
		clearTimeout(timeout);
	});
	$(".pop_body").bind("click", function() {
		Const.msg._targetid = "tid_" + window.returnValue.split("$#$")[0].trim();
		Common.OpenMsgWin();
		window.nativeWindow.close();
	});
});
